package com.csdj.controller;

import com.csdj.pojo.Department;
import com.csdj.service.DepartmentService;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class DepartmentController {
    @Autowired
    private DepartmentService department;

    @RequestMapping(value ="/getDepartment" )
    public String getDepartment(HttpSession session){
        List<Department> departments = department.getBaseMapper().selectList(null);
        session.setAttribute("departments",departments);
        return "redirect:/getEnterpriseTalent";
    }
    @RequestMapping(value ="/getDepartmentByAdd" )
    public String getDepartmentByAdd(HttpSession session){
        List<Department> departments = department.getBaseMapper().selectList(null);
        session.setAttribute("departments",departments);
        return "addInfo";
    }
}
